package com.shamar.blog.entity;

import java.util.Date;
import com.github.rjeschke.txtmark.Processor;
import lombok.Data;

/**
 * @author fangxiaoming
 * @update 2020-07-21 20:08
 */
@Data
public class BlogContent {
    private Integer id;

    private Integer userId;

    private Integer categoryId;

    private String labelId;

    private String content;

    private String title;

    private String categoryName;

    private Integer starCount;

    private Date createtime;

    private Date lastEdittime;

    private Date pushtime;

    private Integer status;

    private String htmlContent;

    private Integer readSize;

    private Integer commentSize;

    private Integer voteSize;

    public void setLabelId(String labelId) {
        this.labelId = labelId == null ? null : labelId.trim();
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
        this.htmlContent = Processor.process(content);
    }
}

//    public void setHtmlContent(String htmlContent) {
//        this.htmlContent = htmlContent == null ? null : htmlContent.trim();
//    }
